FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-stretch-slim AS base
WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_ENVIRONMENT=Production

FROM mcr.microsoft.com/dotnet/core/sdk:2.1-stretch AS build
WORKDIR /src
COPY ["RongCloudSms/RongCloudSms.csproj", "RongCloudSms/"]
RUN dotnet restore "RongCloudSms/RongCloudSms.csproj"  -s http://nexus.cotcotc.com:30080/repository/nuget-group/ 
COPY . .
WORKDIR "/src/RongCloudSms"
RUN dotnet build "RongCloudSms.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "RongCloudSms.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "RongCloudSms.dll"]